package thread.basepackage.t7;

/**
 * suspend方法导致对象被独占
 * Created by cuihao on 2017/11/29.
 */
public class SynchronizedObject {
    synchronized public void printString() {
        System.out.println("begin");
        if (Thread.currentThread().getName().equals("a")) {
            System.out.println("a线程永远suspend了");
            Thread.currentThread().suspend();
        }
        System.out.println("end");
    }
}
